package com.zhumo.sz.controller;


import com.zhumo.sz.common.CommonInsert;
import com.zhumo.sz.common.Result;
import com.zhumo.sz.entity.bike.SharedBikeOrderDetail;
import com.zhumo.sz.entity.subway.SubwayGateSwipeDetail;
import com.zhumo.sz.service.SharedBikeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/sz/service/bike")
public class BikeController {


    @Autowired
    private SharedBikeService sharedBikeService;

    @GetMapping("/add")
    public Result<String> mockSubwayTraffic(@RequestParam int num, @RequestParam String startDate, @RequestParam String endDate,@RequestParam String type){
        CommonInsert<SharedBikeOrderDetail> bikeCommentInsert = sharedBikeService.setBikeOrder(num, startDate, endDate, type);
        String message = "成功插入" + bikeCommentInsert.getResult() + "条共享单车流量信息";
        log.info(message);
        return Result.ok(message);
    }


}
